<template>
  <simple-table 
  :columns="pageData.columns" 
  :rowkey="pageData.pageConfig.rowKey" 
  :agilePageCode="pageData.pageConfig.agilePageCode"
  :dictValues="pageData.dictValues"
  ></simple-table>
</template>
<script>
  import {queryMaterialCategoryTreeList, agileTemplate} from '@/api/api'
  import { postAction } from '@/api/manage'
  import { getMpListShort } from "@/utils/util"
  import { JTableListMixin } from '@/mixins/JTableListMixin'
  import JDate from '@/components/jeecg/JDate'
  import SimpleTable from '@/components/table/SimpleTable'
  import Vue from 'vue'
  export default {
    name: "SimpleTablePage",
    mixins:[JTableListMixin],
    components: {
      SimpleTable,
      JDate
    },
    data () {
      return {
        pageData: {
          pageConfig: {
            rowKey: "id",
            agilePageCode: 'PERMISSION_ROLE'
          },
          // 表头
          columns: [
            { label: 'ID', fieldName: 'id', width:40, align:"center", customRender: function (t,r,index) {return parseInt(index)+1;}},
            { label: '登录名称', fieldName: 'loginName', width: 100, align: "center", searchable: true, insertable: true, updateable: false},
            { label: '用户姓名', fieldName: 'username', width: 100, align: "center", searchable: true, insertable: true, updateable: true},
            { label: '用户类型', fieldName: 'userType', width: 80, align: "center" , searchable: true, insertable: true, updateable: false},
            { label: '角色', fieldName: 'roleName', width: 100, align: "center", insertable: true},            
            { label: '操作', fieldName: 'action', align:"center", width: '10%', scopedSlots: { customRender: 'action' },}
          ],
          
          dictValues: {},
          buttons:[]
        }
      }
    },
    computed: {
    },
    created() {
      var that = this;
        let pg = {}
        pg["agilePageCode"] = that.pageData.pageConfig.agilePageCode;
        agileTemplate.getPageConfig(pg).then(function (res) {
          if (res.ok) {
            that.pageData = Object.assign({}, that.pageData, res.data)
          }
        });
    },
    methods: {
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>